package com.yxb.request.service.impl;

import java.util.List;
import com.yxb.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yxb.request.mapper.ParentRequestMapper;
import com.yxb.request.domain.ParentRequest;
import com.yxb.request.service.IParentRequestService;

/**
 * 家长发布的辅导需求Service业务层处理
 * 
 * @author 林德炫
 * @date 2025-03-04
 */
@Service
public class ParentRequestServiceImpl implements IParentRequestService 
{
    @Autowired
    private ParentRequestMapper parentRequestMapper;

    /**
     * 查询家长发布的辅导需求
     * 
     * @param requestId 家长发布的辅导需求主键
     * @return 家长发布的辅导需求
     */
    @Override
    public ParentRequest selectParentRequestByRequestId(Long requestId)
    {
        return parentRequestMapper.selectParentRequestByRequestId(requestId);
    }

    /**
     * 查询家长发布的辅导需求列表
     * 
     * @param parentRequest 家长发布的辅导需求
     * @return 家长发布的辅导需求
     */
    @Override
    public List<ParentRequest> selectParentRequestList(ParentRequest parentRequest)
    {
        return parentRequestMapper.selectParentRequestList(parentRequest);
    }

    /**
     * 新增家长发布的辅导需求
     * 
     * @param parentRequest 家长发布的辅导需求
     * @return 结果
     */
    @Override
    public int insertParentRequest(ParentRequest parentRequest)
    {
        parentRequest.setCreateTime(DateUtils.getNowDate());
        return parentRequestMapper.insertParentRequest(parentRequest);
    }

    /**
     * 修改家长发布的辅导需求
     * 
     * @param parentRequest 家长发布的辅导需求
     * @return 结果
     */
    @Override
    public int updateParentRequest(ParentRequest parentRequest)
    {
        return parentRequestMapper.updateParentRequest(parentRequest);
    }

    /**
     * 批量删除家长发布的辅导需求
     * 
     * @param requestIds 需要删除的家长发布的辅导需求主键
     * @return 结果
     */
    @Override
    public int deleteParentRequestByRequestIds(Long[] requestIds)
    {
        return parentRequestMapper.deleteParentRequestByRequestIds(requestIds);
    }

    /**
     * 删除家长发布的辅导需求信息
     * 
     * @param requestId 家长发布的辅导需求主键
     * @return 结果
     */
    @Override
    public int deleteParentRequestByRequestId(Long requestId)
    {
        return parentRequestMapper.deleteParentRequestByRequestId(requestId);
    }
}
